<?php
/**
*
*总部信息统计
*
*/
//采用redis来进行缓存

$redis = new Redis();
  //连接服务器
  $redis->connect("localhost");
  //授权
  $redis->auth("redis=pwd@2016");

// $redis->hmset('National_Main', array('allnow' =>$allnow, 'allday'=>$allday,
// 'first'=>$first,'second'=>$second,'sale'=>$sale,'service'=>$service,'login'=>$login,
// 'nolog'=>$nolog,'history'=>$history));
switch ($address) {
  case '北京博瑞祥星汽车销售有限公司':
    $redis = new Redis();
    $redis->connect('127.0.0.1', 6379);
    $redis->hmset('4S_GManager_brxx',  array('allnow'=>$allnow,
    'allday'=>$allday,
    'first'=>$first,
    'second'=>$second,
    'sale'=>$sale,
    'service'=>$service,
    'login'=>$login,
    'nolog'=>$nolog,
    'history'=>$history));
    break;
  case '义乌市博奥汽车销售服务有限公司':
    $redis = new Redis();
    $redis->connect('127.0.0.1', 6379);
    $redis->hmset('4S_GManager_ywba',  array('allnow'=>$allnow,
    'allday'=>$allday,
    'first'=>$first,
    'second'=>$second,
    'sale'=>$sale,
    'service'=>$service,
    'login'=>$login,
    'nolog'=>$nolog,
    'history'=>$history));
    break;
  case '广东粤奥汽车销售服务有限公司':
    $redis = new Redis();
    $redis->connect('127.0.0.1', 6379);
    $redis->hmset('4S_GManager_gdya',  array('allnow'=>$allnow,
    'allday'=>$allday,
    'first'=>$first,
    'second'=>$second,
    'sale'=>$sale,
    'service'=>$service,
    'login'=>$login,
    'nolog'=>$nolog,
    'history'=>$history));
    break;
  case '辽宁鑫迪汽车销售服务有限公司':
    $redis = new Redis();
    $redis->connect('127.0.0.1', 6379);
    $redis->hmset('4S_GManager_lnxd',  array('allnow'=>$allnow,
    'allday'=>$allday,
    'first'=>$first,
    'second'=>$second,
    'sale'=>$sale,
    'service'=>$service,
    'login'=>$login,
    'nolog'=>$nolog,
    'history'=>$history));
    break;
  case '成都新元素雅麓汽车销售服务有限公司':
    $redis = new Redis();
    $redis->connect('127.0.0.1', 6379);
    $redis->hmset('4S_GManager_cdyl',  array('allnow'=>$allnow,
    'allday'=>$allday,
    'first'=>$first,
    'second'=>$second,
    'sale'=>$sale,
    'service'=>$service,
    'login'=>$login,
    'nolog'=>$nolog,
    'history'=>$history));
    break;
  case '云南驰泰汽车销售服务有限公司':
    $redis = new Redis();
    $redis->connect('127.0.0.1', 6379);
    $redis->hmset('4S_GManager_ynct',  array('allnow'=>$allnow,
    'allday'=>$allday,
    'first'=>$first,
    'second'=>$second,
    'sale'=>$sale,
    'service'=>$service,
    'login'=>$login,
    'nolog'=>$nolog,
    'history'=>$history));
    break;
  case '宁夏奥立升汽车销售服务有限公司':
    $redis = new Redis();
    $redis->connect('127.0.0.1', 6379);
    $redis->hmset('4S_GManager_nxals',  array('allnow'=>$allnow,
    'allday'=>$allday,
    'first'=>$first,
    'second'=>$second,
    'sale'=>$sale,
    'service'=>$service,
    'login'=>$login,
    'nolog'=>$nolog,
    'history'=>$history));
    break;
  case '陕西奥诚汽车销售服务有限公司':
    $redis = new Redis();
    $redis->connect('127.0.0.1', 6379);
    $redis->hmset('4S_GManager_sxac',  array('allnow'=>$allnow,
    'allday'=>$allday,
    'first'=>$first,
    'second'=>$second,
    'sale'=>$sale,
    'service'=>$service,
    'login'=>$login,
    'nolog'=>$nolog,
    'history'=>$history));
    break;
}


$data=$redis->hmget('National_Main', array('allnow','allday',
 'first','second','sale','service','login'
 ,'nolog','history'));

 $allnow=$data['allnow'];
 $allday=$data['allday'];
 $first=$data['first'];
 $second=$data['second'];
 $sale=$data['sale'];
 $service=$data['service'];
 $login=$data['login'];
 $nolog=$data['nolog'];
 $history=$data['history'];

require('./view/iwocar5/National_Main.html');
 ?>
